﻿<phone:PhoneApplicationPage 
    x:Class="MobiSms.Wasun.Views.SerialRegisterView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:viewmodel="clr-namespace:MobiSms.ViewModel;assembly=MobiSms.ViewModel"
    xmlns:UX="clr-namespace:MobiSms.UX;assembly=MobiSms.UX"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480"
    shell:SystemTray.IsVisible="False">

    <Grid x:Name="LayoutRoot">
        <Grid.DataContext>
            <viewmodel:SerialRegisterViewModel/>
        </Grid.DataContext>
        <Grid.Background>
            <ImageBrush ImageSource="{Binding GlobalSettings.BackgroundImage}" Stretch="{Binding GlobalSettings.BackgroundImageStretch}" />
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock Text="{StaticResource IDS_APP_NAME}" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock Text="{StaticResource IDS_SERIAL_REGISTER}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="auto"/>
            </Grid.ColumnDefinitions>
            <ScrollViewer>
                <StackPanel>
                    <TextBlock Style="{StaticResource PhoneTextSubtleStyle}" Text="{StaticResource IDS_SERIAL_SERIAL}" />
                    <TextBox Text="{Binding SerialItemToAdd.SerialNumber, Mode=TwoWay}" InputScope="LogOnName" />
                    <TextBlock Style="{StaticResource PhoneTextSubtleStyle}" Text="{StaticResource IDS_SERIAL_PASSWORD}" />
                    <TextBox Text="{Binding SerialItemToAdd.Password, Mode=TwoWay}" InputScope="Number" />
                    <TextBlock Style="{StaticResource PhoneTextSubtleStyle}" Text="{StaticResource IDS_SERIAL_SIGNATURE}" />
                    <TextBox Text="{Binding SerialItemToAdd.Signature, Mode=TwoWay}" />
                    <TextBlock Style="{StaticResource PhoneTextSubtleStyle}" Text="{StaticResource IDS_SERIAL_PROVINCE}" />
                    <!--<TextBox Text="{Binding SerialItemToAdd.Province, Mode=TwoWay}" />-->
                    <toolkit:AutoCompleteBox ItemsSource="{Binding Provinces, Mode=OneWay}" 
                                             Text="{Binding SerialItemToAdd.Province, Mode=TwoWay}"
                                             FilterMode="Contains" 
                                             SelectedItem="{Binding SelectedProvince, Mode=TwoWay}"/>
                    <TextBlock Style="{StaticResource PhoneTextSubtleStyle}" Text="{StaticResource IDS_SERIAL_CITY}" />
                    <toolkit:AutoCompleteBox ItemsSource="{Binding Cities, Mode=OneWay}" 
                                             Text="{Binding SerialItemToAdd.City, Mode=TwoWay}" 
                                             FilterMode="Contains" />
                    <TextBlock Style="{StaticResource PhoneTextSubtleStyle}" Text="{StaticResource IDS_SERIAL_ADDRESS}" />
                    <TextBox Text="{Binding SerialItemToAdd.Address, Mode=TwoWay}" />
                    <TextBlock Style="{StaticResource PhoneTextSubtleStyle}" Text="{StaticResource IDS_SERIAL_FULLNAME}" />
                    <TextBox Text="{Binding SerialItemToAdd.Fullname, Mode=TwoWay}" />
                    <TextBlock Style="{StaticResource PhoneTextSubtleStyle}" Text="{StaticResource IDS_SERIAL_LINKMAN}" />
                    <TextBox Text="{Binding SerialItemToAdd.Linkman, Mode=TwoWay}" />
                    <TextBlock Style="{StaticResource PhoneTextSubtleStyle}" Text="{StaticResource IDS_SERIAL_PHONE}" />
                    <TextBox Text="{Binding SerialItemToAdd.Phone, Mode=TwoWay}" InputScope="TelephoneNumber" />
                    <TextBlock Style="{StaticResource PhoneTextSubtleStyle}" Text="{StaticResource IDS_SERIAL_MOBILE}" />
                    <TextBox Text="{Binding SerialItemToAdd.Mobile, Mode=TwoWay}" InputScope="Number" />
                    <TextBlock Style="{StaticResource PhoneTextSubtleStyle}" Text="{StaticResource IDS_SERIAL_EMAIL}" />
                    <TextBox Text="{Binding SerialItemToAdd.Email, Mode=TwoWay}" InputScope="EmailSmtpAddress" />
                </StackPanel>
            </ScrollViewer>
            
            <StackPanel Grid.Column="1" VerticalAlignment="Bottom">
                <UX:UXPathButton IconPath="{StaticResource PATH_ICON_CLOSE}" Command="{Binding CancelCommand}" Padding="14" Margin="12,0,12,12"/>
                <UX:UXPathButton IconPath="{StaticResource PATH_ICON_SUBMIT}" Margin="12,0,12,12" Command="{Binding RegisterCommand, Mode=OneWay}"/>
            </StackPanel>
        </Grid>
    </Grid>
 
    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

</phone:PhoneApplicationPage>
